package com.xiaoxin.lease.common.exception;

import com.xiaoxin.lease.common.result.ResultCodeEnum;
import lombok.Data;

@Data
public class CheckExitException extends  RuntimeException{

    private Integer code;

    private String msg;

    public CheckExitException(Integer code,String msg){
        this.msg = msg;
        this.code = code;

    }

    public CheckExitException(ResultCodeEnum resultCodeEnum){
        this.msg = resultCodeEnum.getMessage();
        this.code = resultCodeEnum.getCode();
    }

    @Override
    public String toString() {
        return "CheckExitException{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                '}';
    }
}
